package com.matrix.java.chap_05;

/*
    财务应用程序：计算将来的学费
 */
public class Ex5_07 {
    public static void main(String[] args) {
        final double rate = 0.05;
        int fee = 10000;
        int year = 0;
        int sum4Y = 0;
        while (year < 14) {
            fee *= (1 + rate);
            year++;
            if (year == 10) {
                System.out.println(fee);
            }

            if (year >= 10) {
                sum4Y += fee;
            }
        }
        System.out.println(sum4Y);
    }
}
